import Vue from 'vue'
import VueRouter from 'vue-router'



Vue.use(VueRouter)

const routes = [{
    path: '/',
    component: function () {
      return import('../views/index.vue')
    },
    meta: {
      needAuth: true
    },
    children: [{
        path: 'postList',
        component: function () {
          return import('../views/postList.vue')
        },
      },
      {
        path: 'editPost',
        component: function () {
          return import('../views/editPost.vue')
        }
      }
    ]
  },
  {
    path: '/login',
    component: function () {
      return import('../views/login.vue')
    }
  },




]

const router = new VueRouter({
  routes
})

export default router